<?php
/*
 * @ https://EasyToYou.eu - IonCube v11 Decoder Online
 * @ PHP 7.2 & 7.3
 * @ Decoder version: 1.1.6
 * @ Release: 10/08/2022
 */

// Decoded file for php version 71.
namespace app\admin\model;

class AttachmentGroup extends \app\BaseModel
{
    protected $name = "shequshop_school_attachment_group";
    public function searchNameAttr($query, $value, $data)
    {
        $query->where("name", "like", "%" . $value . "%");
    }
    public function createGroup($data)
    {
        $result = $this->save($data);
        return !empty($result);
    }
    public function updateGroup($filter, $data)
    {
        $result = $this->where($filter)->update($data);
        return !empty($result);
    }
    public function listGroup($filter)
    {
        $result = $this->withSearch(["name"], $filter)->where("uniacid", "=", $filter["uniacid"])->order("id")->select();
        if(!empty($result)) {
            $result = $result->toArray();
        }
        return $result;
    }
    public function getGroup($filter)
    {
        $result = $this->where($filter)->find();
        if(!empty($result)) {
            $result = $result->toArray();
        }
        return $result;
    }
    public function delGroup($filter)
    {
        return $this->destoryGroup($filter);
    }
    public function destoryGroup($filter)
    {
        $result = $this->where($filter)->delete();
        return !empty($result);
    }
}

?>